package com.cbgolf.oa.event;

import com.cbgolf.oa.viewbean.OrderBean;

import java.util.List;

/**
 * order event
 *
 * @author lq
 * @date 2018/4/12
 */

public class EventOrder {


  /**
   * 订单列表 数据
   */
  public List<OrderBean> listOrder;
  /**
   * 订单详情 数据
   */
  public OrderBean orderBean;
  /**
   * 消息目的地
   */
  public int target;
  /**
   * 请求操作 refresh loadmore initdata
   */
  public int requestType;

  /**
   * error msg code
   */
  public String errorMsg;
  public int errorCode;

  /**
   * 订单确认成功
   */
  public boolean isConfirmSuccess;
  /**
   * 订单取消成功
   */
  public boolean isCancelSuccess;
  /**
   * 是否酒店订单
   */
  public boolean isHotelOrder;
  /**
   * 订单状态
   */
  public String orderState;
  /**
   * 订单类型
   */
  public String orderType;

  public static class Builder {

    EventOrder order;

    public Builder() {
      order = new EventOrder();
    }

    public Builder setListOrder(List<OrderBean> list) {
      order.listOrder = list;
      return this;
    }

    public Builder setOrderBean(OrderBean data) {
      order.orderBean = data;
      return this;
    }

    public Builder setRequestType(int type) {
      order.requestType = type;
      return this;
    }

    public Builder setOrderType(String type) {
      order.orderType = type;
      return this;
    }

    public Builder setOrderState(String state) {
      order.orderState = state;
      return this;
    }

    public Builder setIsHotel(boolean isHotel) {
      order.isHotelOrder = isHotel;
      return this;
    }

    public Builder setIsConfirmSuccess(boolean isConfirmSuccess) {
      order.isConfirmSuccess = isConfirmSuccess;
      return this;
    }

    public Builder setIsCancelSuccess(boolean isCancelSuccess) {
      order.isCancelSuccess = isCancelSuccess;
      return this;
    }

    public Builder setError(String error, int code) {
      order.errorMsg = error;
      order.errorCode = code;
      return this;
    }

    public Builder setTarget(int target) {
      order.target = target;
      return this;
    }

    public EventOrder build() {
      return order;
    }
  }

}
